<Project Sdk="Microsoft.NET.Sdk">
  <Import Condition="'$(TargetOS)' == 'browser'" Project="$(CommonTestPath)System/Net/Prerequisites/LocalEchoServer.props" />

  <PropertyGroup>
    <StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath>
    <DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL;HTTP3</DefineConstants>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-linux;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-osx</TargetFrameworks>
    <EnablePreviewFeatures>true</EnablePreviewFeatures>
    <EventSourceSupport Condition="'$(TestNativeAot)' == 'true'">true</EventSourceSupport>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TargetsWindows</DefineConstants>
    <DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'browser'">$(DefineConstants);TARGETS_BROWSER</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetOS)' == 'browser'">
    <!-- This doesn't run on V8 because it lacks websocket support -->
    <Scenario>WasmTestOnBrowser</Scenario>
    <TestArchiveTestsRoot>$(TestArchiveRoot)browserornodejs/</TestArchiveTestsRoot>
    <TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
    <DefineConstants>$(DefineConstants);TARGET_BROWSER</DefineConstants>
    <XunitShowProgress>true</XunitShowProgress>
    <!-- This WASM test is problematic and slow right now. This sets the xharness timeout but there is also override in sendtohelix-browser.targets -->
    <WasmXHarnessTestsTimeout>01:15:00</WasmXHarnessTestsTimeout>
  </PropertyGroup>

  <ItemGroup>
    <WasmExtraFilesToDeploy Include="package.json" />
    <WasmExtraFilesToDeploy Include="package-lock.json" />

    <NodeNpmModule Include="ws" Alias="WebSocket" />
    <NodeNpmModule Include="node-fetch" />
    <NodeNpmModule Include="node-abort-controller" />

    <TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptor.xml" Condition="'$(TargetOS)' == 'browser'" />
  </ItemGroup>

  <ItemGroup>
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs" Condition="'$(TargetPlatformIdentifier)' != 'windows'"
             Link="Common\Interop\Unix\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
             Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" Condition="'$(TargetPlatformIdentifier)' != 'windows'"
             Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" />
    <Compile Include="$(CommonTestPath)System\Buffers\NativeMemoryManager.cs"
             Link="Common\System\Buffers\NativeMemoryManager.cs" />
    <Compile Include="$(CommonTestPath)System\Diagnostics\Tracing\TestEventListener.cs"
             Link="Common\System\Diagnostics\Tracing\TestEventListener.cs" />
    <Compile Include="$(CommonTestPath)System\Diagnostics\Tracing\ConsoleEventListener.cs"
             Link="Common\System\Diagnostics\Tracing\ConsoleEventListener.cs" />
    <Compile Include="$(CommonTestPath)System\IO\ByteLoggingStream.cs"
             Link="Common\System\IO\ByteLoggingStream.cs" />
    <Compile Include="$(CommonTestPath)System\IO\DelegateDelegatingStream.cs"
             Link="CommonTest\System\IO\DelegateDelegatingStream.cs" />
    <Compile Include="$(CommonTestPath)System\IO\DelegateStream.cs"
             Link="Common\System\IO\DelegateStream.cs" />
    <Compile Include="$(CommonPath)System\IO\DelegatingStream.cs"
             Link="Common\System\IO\DelegatingStream.cs" />
    <Compile Include="$(CommonTestPath)System\Net\RemoteServerQuery.cs"
             Link="Common\System\Net\RemoteServerQuery.cs" />
    <Compile Include="$(CommonTestPath)System\Security\Cryptography\PlatformSupport.cs"
             Link="CommonTest\System\Security\Cryptography\PlatformSupport.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Configuration.Certificates.cs"
             Link="Common\System\Net\Configuration.Certificates.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Configuration.Certificates.Dynamic.cs"
             Link="Common\System\Net\Configuration.Certificates.Dynamic.cs" />
    <Compile Include="$(CommonTestPath)System\Security\Cryptography\X509Certificates\CertificateAuthority.cs"
             Link="CommonTest\System\Security\Cryptography\X509Certificates\CertificateAuthority.cs" />
    <Compile Include="$(CommonTestPath)System\Security\Cryptography\X509Certificates\RevocationResponder.cs"
             Link="CommonTest\System\Security\Cryptography\X509Certificates\RevocationResponder.cs" />
    <Compile Include="$(CommonTestPath)System\Net\EventSourceTestLogging.cs"
             Link="Common\System\Net\EventSourceTestLogging.cs" />
    <Compile Include="$(CommonTestPath)System\Net\HttpsTestServer.cs"
             Link="Common\System\Net\HttpsTestServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Capability.Security.cs"
             Link="Common\System\Net\Capability.Security.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Capability.Security.Windows.cs" Condition="'$(TargetPlatformIdentifier)' == 'windows'"
             Link="Common\System\Net\Capability.Security.Windows.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Capability.Security.Unix.cs" Condition="'$(TargetPlatformIdentifier)' != 'windows'"
             Link="Common\System\Net\Capability.Security.Unix.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Configuration.cs"
             Link="Common\System\Net\Configuration.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Configuration.Http.cs"
             Link="Common\System\Net\Configuration.Http.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Configuration.Security.cs"
             Link="Common\System\Net\Configuration.Security.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Configuration.Sockets.cs"
             Link="Common\System\Net\Configuration.Sockets.cs" />
    <Compile Include="$(CommonTestPath)System\Net\TestWebProxies.cs"
             Link="Common\System\Net\TestWebProxies.cs" />
    <Compile Include="$(CommonTestPath)System\Net\VerboseTestLogging.cs"
             Link="Common\System\Net\VerboseTestLogging.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpAgnosticLoopbackServer.cs"
             Link="Common\System\Net\Http\HttpAgnosticLoopbackServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\LoopbackProxyServer.cs"
             Link="Common\System\Net\Http\LoopbackProxyServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\LoopbackServer.cs"
             Link="Common\System\Net\Http\LoopbackServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\LoopbackServer.AuthenticationHelpers.cs"
             Link="Common\System\Net\Http\LoopbackServer.AuthenticationHelpers.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\GenericLoopbackServer.cs"
             Link="Common\System\Net\Http\GenericLoopbackServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTestBase.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTestBase.cs" />
    <Compile Include="$(CommonTestPath)System\Net\SslProtocolSupport.cs"
             Link="Common\System\Net\SslProtocolSupport.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\TestHelper.cs"
             Link="Common\System\Net\Http\TestHelper.cs" />
    <Compile Include="$(CommonTestPath)System\Threading\TrackingSynchronizationContext.cs"
             Link="Common\System\Threading\TrackingSynchronizationContext.cs" />
    <Compile Include="$(CommonTestPath)System\Threading\Tasks\GetStateMachineData.cs"
             Link="Common\System\Threading\Tasks\GetStateMachineData.cs" />
    <Compile Include="$(CommonTestPath)System\Threading\Tasks\TaskTimeoutExtensions.cs"
             Link="Common\System\Threading\Tasks\TaskTimeoutExtensions.cs" />
    <Compile Include="AssemblyInfo.cs" />
    <Compile Include="ByteArrayContentTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\ChannelBindingAwareContent.cs"
             Link="Common\System\Net\Http\ChannelBindingAwareContent.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\DribbleStream.cs"
             Link="Common\System\Net\Http\DribbleStream.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\CustomContent.cs"
             Link="Common\System\Net\Http\CustomContent.cs" />
    <Compile Include="DelegatingHandlerTest.cs" />
    <Compile Include="FakeDiagnosticSourceListenerObserver.cs" />
    <Compile Include="FormUrlEncodedContentTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\ByteAtATimeContent.cs"
             Link="Common\System\Net\Http\ByteAtATimeContent.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.Asynchrony.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.Asynchrony.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.Authentication.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.Authentication.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.AutoRedirect.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.AutoRedirect.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.Cancellation.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.Cancellation.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.ClientCertificates.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.ClientCertificates.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.Cookies.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.Cookies.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.DefaultProxyCredentials.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.DefaultProxyCredentials.cs" />
    <Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
             Link="Common\TestUtilities\System\DisableParallelization.cs" />
    <Compile Include="HttpClientHandlerTest.General.cs" />
    <Compile Include="HttpClientHandlerTest.AltSvc.cs" />
    <Compile Include="SocketsHttpHandlerTest.Cancellation.cs" />
    <Compile Include="SocketsHttpHandlerTest.Http1KeepAlive.cs" />
    <Compile Include="SocketsHttpHandlerTest.Http2ExtendedConnect.cs" />
    <Compile Include="SocketsHttpHandlerTest.Http2FlowControl.cs" />
    <Compile Include="SocketsHttpHandlerTest.Http2KeepAlivePing.cs" />
    <Compile Include="HttpClientHandlerTest.Connect.cs" />
    <Compile Include="HttpClientHandlerTest.Finalization.cs" />
    <Compile Include="HttpClientHandlerTest.Headers.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.MaxConnectionsPerServer.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.MaxConnectionsPerServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.MaxResponseHeadersLength.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.MaxResponseHeadersLength.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.Proxy.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.Proxy.cs" />
    <Compile Include="HttpClientHandlerTest.Http3.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.RemoteServer.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.RemoteServer.cs" />
    <Compile Include="HttpClientHandlerTest.RequestRetry.cs" />
    <Compile Include="HttpClientHandlerTest.ResponseDrain.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.ServerCertificates.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.ServerCertificates.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.SslProtocols.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.SslProtocols.cs" />
    <Compile Include="HttpClientHandlerTestBase.SocketsHttpHandler.cs" />
    <Compile Include="DiagnosticsTests.cs" />
    <Compile Include="HttpClientTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientEKUTest.cs" Condition="'$(TargetPlatformIdentifier)' != 'browser'"
             Link="Common\System\Net\Http\HttpClientEKUTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClient.SelectedSitesTest.cs"
             Link="Common\System\Net\Http\HttpClient.SelectedSitesTest.cs" />
    <Compile Include="HttpConnectionKeyTest.cs" />
    <Compile Include="HttpContentTest.cs" />
    <Compile Include="HttpMessageInvokerTest.cs" />
    <Compile Include="HttpMethodTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\IdnaProtocolTests.cs"
             Link="Common\System\Net\Http\IdnaProtocolTests.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpProtocolTests.cs"
             Link="Common\System\Net\Http\HttpProtocolTests.cs" />
    <Compile Include="HttpRequestMessageTest.cs" />
    <Compile Include="HttpResponseMessageTest.cs" />
    <Compile Include="MessageProcessingHandlerTest.cs" />
    <Compile Include="MetricsTest.cs" />
    <Compile Include="MultipartContentTest.cs" />
    <Compile Include="MultipartFormDataContentTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\PostScenarioTest.cs"
             Link="Common\System\Net\Http\PostScenarioTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\RepeatedFlushContent.cs"
             Link="Common\System\Net\Http\RepeatedFlushContent.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\ResponseStreamTest.cs"
             Link="Common\System\Net\Http\ResponseStreamTest.cs" />
    <Compile Include="SyncHttpHandlerTest.cs" />
    <Compile Include="TelemetryTest.cs" />
    <Compile Include="StreamContentTest.cs" />
    <Compile Include="StringContentTest.cs" />
    <Compile Include="ResponseStreamConformanceTests.cs" />
    <Compile Include="ResponseStreamZeroByteReadTests.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\SyncBlockingContent.cs"
             Link="Common\System\Net\Http\SyncBlockingContent.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\DefaultCredentialsTest.cs"
             Link="Common\System\Net\Http\DefaultCredentialsTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\ThrowingContent.cs"
             Link="Common\System\Net\Http\ThrowingContent.cs" />
    <Compile Include="ThrowingContent.netcore.cs" />
    <Compile Include="Watchdog.cs" />
    <Compile Include="$(CommonTestPath)System\IO\ConnectedStreams.cs"
             Link="Common\System\IO\ConnectedStreams.cs" />
    <Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs"
             Link="ProductionCode\Common\System\Net\ArrayBuffer.cs" />
    <Compile Include="$(CommonPath)System\Net\MultiArrayBuffer.cs"
             Link="ProductionCode\Common\System\Net\MultiArrayBuffer.cs" />
    <Compile Include="$(CommonPath)System\Net\StreamBuffer.cs"
             Link="ProductionCode\Common\System\Net\StreamBuffer.cs" />
  </ItemGroup>
  <!-- Windows specific files -->
  <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="NtAuthTests.Windows.cs" />
    <Compile Include="ImpersonatedAuthTests.cs" />
  </ItemGroup>
  <!-- Linux specific files -->
  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'linux' or '$(TargetPlatformIdentifier)' == 'browser'">
    <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs"
             Link="Common\Interop\Linux\Interop.Libraries.cs" />
  </ItemGroup>
  <!-- OSX specific files -->
  <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'osx' ">
    <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs"
             Link="Common\Interop\OSX\Interop.Libraries.cs" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="CustomContent.netcore.cs" />
    <Compile Include="HPackTest.cs" />
    <Compile Include="HttpClientHandlerTest.Http1.cs" />
    <Compile Include="HttpClientHandlerTest.Http2.cs" />
    <Compile Include="HttpClientHandlerTest.Url.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.AcceptAllCerts.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.AcceptAllCerts.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.Decompression.cs"
             Link="Common\System\Net\Http\HttpClientHandlerTest.Decompression.cs" />
    <Compile Include="HttpClientMiniStressTest.cs" />
    <Compile Include="NtAuthTests.cs" />
    <Compile Include="NtAuthTests.FakeServer.cs" />
    <Compile Include="ReadOnlyMemoryContentTest.cs" />
    <Compile Include="SocketsHttpHandlerTest.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\Http2Frames.cs"
             Link="Common\System\Net\Http\Http2Frames.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HPackEncoder.cs"
             Link="Common\System\Net\Http\HPackEncoder.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\QPackTestDecoder.cs"
             Link="Common\System\Net\Http\QPackTestDecoder.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\QPackTestEncoder.cs"
             Link="Common\System\Net\Http\QPackTestEncoder.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\Http2LoopbackServer.cs"
             Link="Common\System\Net\Http\Http2LoopbackServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\Http2LoopbackConnection.cs"
             Link="Common\System\Net\Http\Http2LoopbackConnection.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackServer.cs"
             Link="Common\System\Net\Http\Http3LoopbackServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackConnection.cs"
             Link="Common\System\Net\Http\Http3LoopbackConnection.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackStream.cs"
             Link="Common\System\Net\Http\Http3LoopbackStream.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HuffmanDecoder.cs"
             Link="Common\System\Net\Http\HuffmanDecoder.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Http\HuffmanEncoder.cs"
             Link="Common\System\Net\Http\HuffmanEncoder.cs" />
    <Compile Include="LoopbackSocksServer.cs" />
    <Compile Include="SocksProxyTest.cs" />
  </ItemGroup>
  <!-- NTLM/Negotiate authentication fakes -->
  <ItemGroup>
    <Compile Include="$(CommonPath)System\Net\Security\MD4.cs"
             Link="Common\System\Net\Security\MD4.cs" />
    <Compile Include="$(CommonPath)System\Net\Security\RC4.cs"
             Link="Common\System\Net\Security\RC4.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Security\FakeNtlmServer.cs"
             Link="Common\System\Net\Security\FakeNtlmServer.cs" />
    <Compile Include="$(CommonTestPath)System\Net\Security\FakeNegotiateServer.cs"
             Link="Common\System\Net\Security\FakeNegotiateServer.cs" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="SelectedSitesTest.txt">
      <Link>SelectedSitesTest.txt</Link>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="System.Net.TestData" Version="$(SystemNetTestDataVersion)" />
    <ProjectReference Include="$(LibrariesProjectRoot)System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
  </ItemGroup>
</Project>
